<?php
namespace app\common\model;
use think\Model;
use think\Db;
/**
 * 工单-退单
 *
 * @author lcx
 */
class WorkOrderReturnModel extends Model{

    protected $name = 'work_order_return';
    /**
     * 查询所有
     * @param type $where
     * @param type $field
     * @param type $join
     * @param type $order
     * @return type
     */
    public function getAll($where = [],$field = '*',$join=[])
    {
        $data = $this->join($join)
                ->field($field)             
                ->where($where)         
                ->select();
        // 返回结果
        return $data;
    }

    // 删除数据
    public function delete($where=[])
    {
        $result = $this->where($where)->delete();
        return $result;
    }

    // 添加数据
    public function add($data=[])
    {
        $result = $this->insertGetId($data);
        return $result;
    }
    // 修改数据
    public function edit($where, $data)
    {
        $result = $this->where($where)->update($data);
        return $result;
    }
    //计数
    public function count($where){
        $count = $this->where($where)->count();
        return $count;
    }

}
